package org.linlinjava.litemall.db.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.linlinjava.litemall.db.dao.LitemallOrderFormulaMaterialMapper;
import org.linlinjava.litemall.db.domain.LitemallOrderFormulaMaterial;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LitemallOrderFormulaMaterialService extends MPJBaseServiceImpl<LitemallOrderFormulaMaterialMapper, LitemallOrderFormulaMaterial> {

    public List<LitemallOrderFormulaMaterial> selectByOrderGoodsIdList(Integer orderGoodsId){
        return getBaseMapper().selectList(Wrappers.lambdaQuery(LitemallOrderFormulaMaterial.class).eq(LitemallOrderFormulaMaterial::getOrderGoodsId,orderGoodsId));
    }

    public List<LitemallOrderFormulaMaterial> selectByOrderMaterialIdList(Integer materialId){
        return getBaseMapper().selectList(Wrappers.lambdaQuery(LitemallOrderFormulaMaterial.class).eq(LitemallOrderFormulaMaterial::getMaterialId,materialId));
    }
}
